Main.xdndHandler.connect('drag-begin', Lang.bind(this, this._onDragBegin));
Main.xdndHandler.connect('drag-end', Lang.bind(this, this._onDragEnd));
+ global.screen.connect('restacked', Lang.bind(this, this._onRestacked));
+
this._windowSwitchTimeoutId = 0;
this._windowSwitchTimestamp = 0;
this._lastActiveWorkspaceIndex = -1;
this._coverPane.set_size(primary.width, contentHeight);
},
+ _onRestacked: function() {
+ let stack = global.get_window_actors();
+ let stackIndices = {};
+
+ for (let i = 0; i < stack.length; i++) {
+ // Use the stable sequence for an integer to use as a hash key
+ stackIndices[stack[i].get_meta_window().get_stable_sequence()] = i;
+ }
+
+ this.emit('windows-restacked', stackIndices);
+ },
+
//// Public methods ////
beginItemDrag: function(source) {
this._nWorkspacesNotifyId =
global.screen.connect('notify::n-workspaces',
Lang.bind(this, this._workspacesChanged));
+ this._syncStackingId =
+ Main.overview.connect('windows-restacked',
+ Lang.bind(this, this._syncStacking));
this._targetScale = 0;
this._scale = 0;
this._nWorkspacesNotifyId = 0;
}
+ if (this._syncStackingId > 0) {
+ Main.overview.disconnect(this._syncStackingId);
+ this._syncStackingId = 0;
+ }
+
for (let w = 0; w < this._thumbnails.length; w++)
this._thumbnails[w].destroy();
this._thumbnails = [];
this._queueUpdateStates();
},
- syncStacking: function(stackIndices) {
+ _syncStacking: function(overview, stackIndices) {
for (let i = 0; i < this._thumbnails.length; i++)
this._thumbnails[i].syncStacking(stackIndices);
},
this._updateWorkspacesViews();
this._restackedNotifyId =
- global.screen.connect('restacked',
+ Main.overview.connect('windows-restacked',
Lang.bind(this, this._onRestacked));
if (this._itemDragBeginId == 0)
if (this._windowDragEndId == 0)
this._windowDragEndId = Main.overview.connect('window-drag-end',
Lang.bind(this, this._dragEnd));
-
- this._onRestacked();
},
zoomFromOverview: function() {
this.zoomFraction = 0;
if (this._restackedNotifyId > 0){
- global.screen.disconnect(this._restackedNotifyId);
+ Main.overview.disconnect(this._restackedNotifyId);
this._restackedNotifyId = 0;
}
if (this._itemDragBeginId > 0) {
}
},
- _onRestacked: function() {
- let stack = global.get_window_actors();
- let stackIndices = {};
-
- for (let i = 0; i < stack.length; i++) {
- // Use the stable sequence for an integer to use as a hash key
- stackIndices[stack[i].get_meta_window().get_stable_sequence()] = i;
- }
-
+ _onRestacked: function(overview, stackIndices) {
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].syncStacking(stackIndices);
-
- this._thumbnailsBox.syncStacking(stackIndices);
},
_workspacesChanged: function() {